/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chatroom.com.chatEvent;

/**
 * 聊天拦截类，用于屏蔽用户输入的骂人字符串
 *
 * @author 李鹏飞
 */
public class ChatFilter {

    final static String filterStr[] = new String[]{"妈逼", "干", "傻逼", "SB", "sb", "死全家", "政府", "操逼"};

    public static String getAfterFilterString(String content) {
        
        for (String temp : filterStr) {
            int index = content.indexOf(temp);
             System.err.println(index+"-------------------------");
            if (index > -1) {
                for (int i = index; i < index + temp.length(); i++) {
                    content = content.replace(content.charAt(i), '*');
                }
            }
            
        }
        System.err.println(content+"-------------------------");
        return content;
    }
}
